import java.util.Scanner;

public class code2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String Ax = sc.next();
        int x =Ax.charAt(1)-'0';//字符串转为数字
        int a = 1189;
        int b = 841;
        for (int i = 0; i < x; i++) {
            a = a/2;
            //始终要保持a是大的那个数
            if(a<b) {
                int tmp = a;
                a = b;
                b =tmp;
            }
        }
        System.out.println(a);
        System.out.println(b);
    }
}
